dirmngr: Avoid endless loop in case of HTTP error 503.
authorWerner Koch <wk@gnupg.org>
Wed, 3 Jul 2019 15:39:53 +0000 (17:39 +0200)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 22 Aug 2019 19:11:59 +0000 (20:11 +0100)
commitbad8496fd44a62fdbbd768f7679f90eb56d739f7
tree8a56515f00e9e9d5c9930dd38c4e25f40317b992
parent74aa31578f2bd01f896387777423447dc5b1fce6
dirmngr: Avoid endless loop in case of HTTP error 503.

* dirmngr/ks-engine-hkp.c (SEND_REQUEST_EXTRA_RETRIES): New.
(handle_send_request_error): Use it for 503 and 504.
(ks_hkp_search, ks_hkp_get, ks_hkp_put): Pass a new var for
extra_tries.
--

This is a pretty stupid fix but one which works without much risk of
regressions.  We could have used the existing TRIES but in that case
the fallback to other host would have been too limited.  With the used
value we can have several fallbacks to other hosts.  Note that the
TRIES is still cumulative and not per host.

GnuPG-bug-id: 4600
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 8b113bb148f273524682252233b3c65954e1419e)
(cherry picked from commit d2e8d71251813e61b15a07637497fabe823b822c)

Gbp-Pq: Topic from-2.2.17
Gbp-Pq: Name dirmngr-Avoid-endless-loop-in-case-of-HTTP-error-503.patch
dirmngr/ks-engine-hkp.c